<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>5-2</title>
    <style>
        body{
            text-align:center;
            font:30px/1.5 \5fae\8f6f\96c5\9ed1,arial;
        }
    </style>
    <script>
        window.onload = function () {
            var oP = document.getElementsByTagName("p")[0];
            document.onkeydown = function (event) {
                var event = event || window.event;
                oP.innerHTML = event.keyCode;
                return false;
            }
        }
    </script>
</head>
<body>
<p></p>
</body>
</html>